﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoanSelectionDialog.ascx.cs" Inherits="LoanSelectionDialog" %>
<%@ Register TagPrefix="ajax" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>

<asp:Button runat="server" ID="hiddenTargetControlLoanModalPopup" Style="display: none" />
<ajax:ModalPopupExtender 
    runat="server" 
    ID="loanModalPopup" 
    TargetControlID="hiddenTargetControlLoanModalPopup" 
    PopupControlID="programmaticPopup"
    DropShadow="True" 
    PopupDragHandleControlID="programmaticPopupDragHandle"
    CancelControlID="cancelButton"  
    RepositionMode="RepositionOnWindowResize">
</ajax:ModalPopupExtender>

<asp:Panel runat="server" ID="programmaticPopup" Width="820px"  Style=" background-color: white; border: 1px solid Gray; display: none; " >

    <div runat="server" ID="programmaticPopupDragHandle" style="border: 1px solid black; text-align:center; font-size:15pt; background-color:Lime; text-transform:uppercase; cursor: move; " >
          <b> <asp:Label ID="WindowTitleLabel" runat="server" Text="LISTA IMPRUMUTURILOR"></asp:Label> </b>
    </div>        
        <asp:UpdatePanel runat="server" ID="loanSelectionDialogUpdatePanel" >
        <ContentTemplate>   

            <div style="height:270px; width:150px; overflow:auto; float:left;">
                <asp:TreeView runat="server" ID="loanCategoriesTreeView" ShowLines="true" onselectednodechanged="loanCategoriesTreeView_SelectedNodeChanged" >
                    <Nodes>
                        <asp:TreeNode Value="0" 
                            Text="All List" 
                            Expanded="True">
                        </asp:TreeNode>
                    </Nodes>
                    <SelectedNodeStyle BackColor="#B7E9E7" />
                </asp:TreeView>
            </div>
            <div style="height:20px; width:650px;float:left;"> 
                <asp:Label ID="Label1" runat="server" Text="Live Filter"></asp:Label>
                <input type="text" runat="server" id="txtSearch" style="width:550px;" runat="server" />    
            </div>
            
            <div style="height:250px; width:650px; overflow:auto;  float:left; margin-top:5px;" runat="server" id="loansListDiv"  >               
                <asp:UpdatePanel runat="server" ID="loansUpdatePanel">
                    <ContentTemplate>
                        <asp:GridView ID="loansGridView" runat="server" 
                            AutoGenerateColumns="False" 
                            CssClass="mGrid"
                            PagerStyle-CssClass="pgr"
                            AlternatingRowStyle-CssClass="alt"
                            AllowPaging="false" 
                            SelectedRowStyle-BackColor="#CCCCFF"
                            onrowdatabound="loansGridView_RowDataBound" 
                            Width="100%" >
                            <Columns>
                                <asp:BoundField DataField="loanID" HeaderStyle-CssClass ="HiddenColumn" ItemStyle-CssClass="HiddenColumn" HtmlEncode="False" />
                                <asp:BoundField DataField="contractCode" HeaderText="Cod" ItemStyle-Width = "50px" HtmlEncode="False" />
                                <asp:BoundField DataField="clientName" HeaderText="Cliet Name" ItemStyle-Width = "250px" HtmlEncode="False" />
                                <asp:BoundField DataField="creditAmountValue" HeaderText="Suma" ItemStyle-Width = "50px" HtmlEncode="False" />
                                <asp:BoundField DataField="nrOfCreditMonthValue" HeaderText="Termen" ItemStyle-Width = "50px" HtmlEncode="False" />
                                <asp:BoundField DataField="percentValue" HeaderText="Procent" ItemStyle-Width = "50px" HtmlEncode="False" />

                                <asp:TemplateField HeaderText="Data Eliberarii">
                                    <ItemTemplate>
                                        <asp:Label ID="loanStartDateLabel" Width="100px" runat="server" Text='<%# ((Eval("loanStartDate") != null && Eval("loanStartDate") is DateTime) ?  ((DateTime)Eval("loanStartDate")).ToString(Constants.Constants.ISODateBackwardDotsFormat) : "") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                
                                <asp:BoundField DataField="loanState_string" HeaderText="Statut" ItemStyle-Width = "150px" HtmlEncode="False" />                                   
                            </Columns>
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>                   
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>
    <div style="text-align:center;">
        <asp:HiddenField ID="selectedLoanIDHiddenField" runat="server" />
        <asp:Button ID="okButton" runat="server" Text="Ok" onclick="okButton_Click" Width="100px" CausesValidation="false" />
        <asp:Button ID="cancelButton" runat="server" Text="Cancel" Width="100px" />
    </div>

</asp:Panel>



  










